!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="9211036a-9402-4883-a4f6-65484d5b044b",e._sentryDebugIdIdentifier="sentry-dbid-9211036a-9402-4883-a4f6-65484d5b044b")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1125],{14639:function(e,r,t){t.d(r,{W:function(){return h}});var a=t(97458),n=t(86101),o=t(23113),i=t(770),l=t(9249),s=t(19213),u=t(18503),c=t(10893),d=t(5943);let h=e=>{let{onDownload:r,isDownloading:t}=e,{t:h}=(0,c.$G)("detailCommon"),m=(0,o.a)("lg"),f=(0,a.jsxs)("button",{className:(0,u.m)(t?"$cursor-not-allowed $pointer-events-none":"$cursor-pointer",d.a),onClick:r,"data-cy":"download-thumbnail",children:[(0,a.jsx)(l.T,{children:h("download")}),(0,a.jsx)(i.J,{as:s.Z,size:"base"})]});return m?(0,a.jsx)(n.u,{side:"left",trigger:f,triggerAsChild:!0,hideOnLeaveHover:!0,children:(0,a.jsx)("span",{className:"$capitalize",children:h("download")})}):f}},46661:function(e,r,t){t.d(r,{L:function(){return h}});var a=t(97458),n=t(86101),o=t(23113),i=t(770),l=t(9249),s=t(27488),u=t(10893),c=t(18313),d=t(5943);let h=e=>{let{t:r}=(0,u.$G)("detailCommon"),t=(0,o.a)("lg"),h=(0,c.X)({tool:"adjust",location:"thumbnail_ai_tools",resourceData:e,queryParams:{from_element:"resource_thumbnail"}}),m=(0,a.jsxs)("button",{className:d.a,onClick:h,"data-cy":"edit-with-ai-thumbnail",children:[(0,a.jsx)(l.T,{children:r("editWithAI")}),(0,a.jsx)(i.J,{as:s.Z,size:"base"})]});return t?(0,a.jsx)(n.u,{side:"left",trigger:m,triggerAsChild:!0,hideOnLeaveHover:!0,children:r("editWithAI")}):m}},5943:function(e,r,t){t.d(r,{Y:function(){return a.YS},a:function(){return a.aD}});var a=t(11031)},3801:function(e,r,t){t.d(r,{c:function(){return d},l:function(){return j}});var a=t(97458),n=t(52983),o=t(90715),i=t(7182),l=t(12805),s=t(5943),u=t(14639),c=t(46661);let d=(0,n.forwardRef)((e,r)=>{let{type:t="photo",id:n,name:d,author:h,onDownload:m,isDownloading:f,media:p,width:w,height:g,calculating:b,children:v,isEditableInWepik:x,isEditableInMockup:_,premium:j,isDownloadEnabled:y,isAIGenerated:k,detailLink:N}=e,$=x||_,I=(0,o.n)({type:t,isEditableInMockup:_,isEditableInWepik:x,authorId:h.id}),T=(0,l.U)(t,$),C=(0,l._)();return(0,a.jsxs)("aside",{className:s.Y({calculating:b}),ref:r,children:[y&&(0,a.jsx)(u.W,{onDownload:m,isDownloading:f}),I&&!T&&(0,a.jsx)(c.L,{id:n,name:d,author:h,premium:j,isAIGenerated:k,preview:{width:w,height:g,url:p},type:t,url:N}),T&&(0,a.jsx)(i.l,{premium:j,id:n,urlEditor:C(n,x)}),v]})});var h=t(86101),m=t(23113),f=t(47092),p=t(770),w=t(9249),g=t(83910),b=t(18503),v=t(10893),x=t(26013),_=t(11031);let j=e=>{let{onShowModal:r,isCollapsed:t,resourceType:n}=e,{t:o}=(0,v.$G)("common"),i=(0,m.a)("lg"),l="icon"===n?_.Mw:x.aD,s=(0,a.jsxs)("button",{className:(0,b.m)("$cursor-pointer",t?x.tw:l),onClick:r,"data-cy":"delete-resource-collection-thumbnail",children:[(0,a.jsx)(w.T,{children:o("remove")}),(0,a.jsx)(p.J,{as:g.Z,size:"base"}),t&&o("remove")]});return i?(0,a.jsx)(h.u,{side:"left",trigger:s,triggerAsChild:!1,hideOnLeaveHover:!0,children:o("remove")}):t?(0,a.jsx)(f.ck,{asChild:!0,children:s}):s}},7182:function(e,r,t){t.d(r,{l:function(){return h}});var a=t(97458),n=t(86101),o=t(23113),i=t(770),l=t(9249),s=t(11569),u=t(10893),c=t(26013),d=t(78571);let h=e=>{let{id:r,premium:t,urlEditor:h}=e,{t:m}=(0,u.$G)("common"),f=(0,o.a)("lg"),p=(0,d.Z)(r,t,h),w=(0,a.jsxs)("button",{className:c.aD,onClick:p,"data-cy":"edit-online-thumbnail",children:[(0,a.jsx)(l.T,{children:m("editOnline")}),(0,a.jsx)(i.J,{as:s.Z,size:"base"})]});return f?(0,a.jsx)(n.u,{side:"left",trigger:w,triggerAsChild:!0,hideOnLeaveHover:!0,children:m("editOnline")}):w}},78571:function(e,r,t){t.d(r,{Z:function(){return s}});var a=t(27793),n=t(91394),o=t(87420),i=t(49737),l=t(35576);let s=(e,r,t)=>{let s=(0,i.m6)(r),u=(0,o.L3)(),{loginUrl:c,setLoginCookies:d}=(0,a.J)(),h=(0,n.d)(),m=(0,l.mS)(),f=()=>s?t:s?h||r?t:(d(),c):"".concat(u("/pricing"),"/").concat(e,"?origin=freepik_web");return()=>{if(!s){m({resourceId:e,isResourcePremium:r,resourceType:"template"}),window.location.href=f();return}window.location.href=f()}}},12805:function(e,r,t){t.d(r,{U:function(){return l},_:function(){return s}});var a=t(7616),n=t(52983),o=t(7526),i=t(31861);let l=(e,r)=>["psd","vector"].includes(e)&&r,s=()=>{let[e]=(0,a.KO)(i.GD);return(0,n.useCallback)((r,t)=>{let a=""===e?"".concat(o.KK).concat(r):"".concat(o.KK).concat(r,"?searchTerm=").concat(e),n="".concat(o.Iq).concat(r,"&provider=fp");return t?a:n},[e])}},87566:function(e,r,t){t.d(r,{N:function(){return n}});var a=t(70870);let n=(e,r)=>{let{height:t}=(0,a.n)(e);return null===t?null:t<=r}},93682:function(e,r,t){t.d(r,{U:function(){return n},w:function(){return a}});let a=200,n=200},51125:function(e,r,t){t.r(r),t.d(r,{ActionsThumbnail:function(){return k},ImageThumbnail:function(){return ec},RelatedThumbnail:function(){return ew}});var a=t(97458),n=t(53344),o=t.n(n),i=t(52983),l=t(65122),s=t(46700),u=t(50987),c=t(65724),d=t(33247),h=t(35576),m=t(64237),f=t(49737),p=t(75045);let w=e=>{let{id:r,name:t,author:a,type:n,premium:o,isAIGenerated:w,url:g,preview:b,isEditableInMockup:v,isEditableInWepik:x}=e,_=(0,d.R)()({authorName:a.name,isPremium:o,isAIGenerated:w,type:n,subtype:(0,m.y)({isEditableInWepik:x,isEditableInMockup:v}),eventName:"download__thumbnail"}),{isDownloading:j,handleDownload:y}=(0,p.i)({resource:{id:r,name:t,author:a,premium:o,regularType:n,isAIGenerated:w,url:g,preview:b},location:"resource_thumbnail",checkoutQueryParams:_,showAttributionModal:!1}),k=(0,s.V)(),N=(0,h.mS)(),$=(0,l.e)(),{contentGroup:I}=(0,f.hv)({id:r,type:n,isAIGenerated:w,premium:o,isEditableInMockup:v,isEditableInWepik:x}),T=(0,c.W)(r,I,"resource_thumbnail"),{showAttribution:C}=(0,u.J)(),P=(0,i.useCallback)(()=>{N({resourceId:r,isResourcePremium:o,resourceType:n,downloadType:"download"})},[N,r,o,n]);return{isDownloading:j,handleDownloadFromThumbnail:(0,i.useCallback)(async()=>{if(!$&&o){T({origin:"resource_thumbnail_premium",resourceData:{name:t,mediaUrl:b.url,mediaWidth:b.width,mediaHeight:b.height,resourceType:"regular"},checkoutQueryParams:_,onButtonClick:P});return}let e=await y();e&&(k(e.url,e.filename),C())},[$,o,y,T,t,b.url,b.width,b.height,_,P,k,C])}};var g=t(47152),b=t(3801),v=t(11031),x=t(70870);let _=(e,r,t)=>{let a=j(r),{height:n}=(0,x.n)(e);return null===a||null===n?null:"keyword"===t?n<200:n{let[r,t]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let r=e.current,a=()=>{r&&t(r.getBoundingClientRect().height+2*v.VX)};a();let n=new MutationObserver(()=>{a()});return r&&n.observe(r,{childList:!0,subtree:!0}),()=>{n.disconnect()}},[e,r]),r},y=o()(()=>t.e(3847).then(t.bind(t,13847)).then(e=>e.ActionsMenu),{loadableGenerated:{webpack:()=>[13847]},ssr:!1}),k=(0,i.memo)(e=>{let{thumbnailRef:r,children:t,fromView:n,...o}=e,l=(0,i.useRef)(null),s=_(r,l,n)||"keyword"===n,{id:u,name:c,author:d,type:h,premium:m,isAIGenerated:f,url:p,media:v,height:x,width:j,isEditableInMockup:k,isEditableInWepik:N}=o,{isDownloading:$,handleDownloadFromThumbnail:I}=w({id:u,name:c,author:d,type:null!=h?h:"photo",premium:m,isAIGenerated:f,url:p,preview:{url:v,height:x,width:j},isEditableInMockup:k,isEditableInWepik:N}),T=s?(0,a.jsx)(y,{...o,thumbnailRef:r,isDownloading:$,onDownload:I,fromView:n,children:t}):(0,a.jsx)(b.c,{...o,ref:l,calculating:null===s,isDownloading:$,onDownload:I,children:t});return(0,a.jsx)(g.T,{isCollapsed:s,children:T})});var N=t(57291),$=t(98821),I=t.n($),T=t(58058),C=t.n(T),P=t(58750),R=t(30948),E=t(73527),A=t(3223),S=t(20339),D=t(63081),O=t(61821),W=t(52294),G=t(41776),L=t(4784),M=t(770),U=t(9249),q=t(30061),J=t(10893),z=t(59470);let H=()=>{let{t:e}=(0,J.$G)("common");return(0,a.jsxs)("span",{className:z.q,children:[(0,a.jsx)(U.T,{children:e("disneyResource")}),(0,a.jsx)(M.J,{as:q.Z,size:"sm",className:"$text-white"})]})},Z=e=>{var r,t,n,o;let{resource:i,isDisneyResource:s=!1,children:u}=e,c=(0,l.e)(),{contentGroup:h}=(0,O.hv)(i),m=(0,d.R)(),{premium:f,isAIGenerated:p,authorName:w,type:g}=i;if(!f&&!p&&!s)return;let b=f&&c,v=i.isEditableInMockup?"mockups":null,x=i.isEditableInWepik?"templates":null,_=null!==(o=null!=v?v:x)&&void 0!==o?o:"premium_regular",j=m({type:g,authorName:w,isPremium:!0,isAIGenerated:p,eventName:"download__thumbnail_crown"});return j.append("origin","".concat(D.Ej,"_").concat(_)),(0,a.jsxs)("div",{className:"absolute left-4 top-4 flex gap-2",children:[b&&(0,a.jsx)("span",{className:z.q,children:(0,a.jsx)(L.s,{})}),f&&!b&&(0,a.jsx)("span",{className:z.q,children:(0,a.jsx)(G.w,{resource:{id:i.id,name:i.name,mediaUrl:null===(r=i.preview)||void 0===r?void 0:r.url,mediaHeight:null===(t=i.preview)||void 0===t?void 0:t.height,mediaWidth:null===(n=i.preview)||void 0===n?void 0:n.width,resourceType:"regular"},urlParams:j,category:h})}),p&&(0,a.jsx)(W.N,{}),s&&(0,a.jsx)(H,{}),u]})};var B=t(51780),F=t(32950),V=t(30143);let K=e=>{let[r,t]=(0,i.useState)("");return(0,i.useEffect)(()=>{{let r=new URLSearchParams(window.location.hash.substring(1)).get(e);null!==r&&t(r)}},[e]),r},X=e=>{var r;let{item:t,isModal:a,position:n,fromView:o}=e,i=(0,B.useRouter)(),l=null!==(r=(0,F.Jn)("term"))&&void 0!==r?r:"",{id:s,url:u}=t,c=K("from_element"),d=(0,V.fb)(s,u,{fromView:o,position:n,fromElement:c,query:l});return a?{href:{pathname:i.pathname,query:i.query},as:d,shallow:!0,scroll:!1}:{href:d}};var Y=t(31760),Q=t(18666),ee=t(38012),er=t(63123),et=t(87566);let ea={ONE_TAG:100,TWO_TAGS:200},en={ONE:1,TWO:2,MAX:3},eo=e=>{let{height:r}=(0,x.n)(e);return null===r||r>ea.TWO_TAGS?en.MAX:r>ea.ONE_TAG?en.TWO:en.ONE},ei=o()(()=>t.e(6303).then(t.bind(t,86303)).then(e=>e.AttributionThumbnail),{loadableGenerated:{webpack:()=>[86303]},ssr:!1}),el=e=>{let{authorId:r,authorName:t,thumbnailRef:n,fromView:o,children:i,url:l,id:s,name:c,preview:d,type:h,topSearchExpressions:f,isAIGenerated:p,isEditableInMockup:w,isEditableInWepik:g,premium:b,blockViewSimilar:v}=e,{attributionEnabled:_}=(0,u.J)(),j=(0,et.N)(n,er.NG),y="keyword"===o,k=eo(n),{width:$}=(0,x.n)(n),I=!!($&&$>=er.CC),T=(0,m.y)({isEditableInMockup:w,isEditableInWepik:g});return _?(0,a.jsx)(ei,{authorId:r,authorName:t,resourceUrl:l,resourceId:s,resourceName:c,mediaUrl:d.url,mediaWidth:d.width,mediaHeight:d.height,isAIGenerated:p,isPremium:b,resourceType:h,subtype:T}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("figcaption",{className:"pointer-events-none absolute inset-0 rounded-xl text-white transition-opacity [background:linear-gradient(180deg,rgba(0,0,0,0.1)_0%,rgba(0,0,0,0.4)_100%)]",children:(0,a.jsxs)("div",{className:"absolute inset-x-4 bottom-4 transition-all",children:[!j&&!y&&!v&&(0,a.jsx)(Q.B,{buttonClassName:(0,N.cx)(ee.p,I?"px-4 py-0":"p-3"),id:s,name:c,preview:d,inThumbnail:!0,showLabel:I,type:h,tooltipProps:{side:"right"}}),y&&(0,a.jsx)(Y.k,{items:f,maxTags:k})]})}),i]})},es=e=>{let{type:r,name:t,isPremium:a,fromView:n}=e,{t:o}=(0,J.$G)("common");if(!n||"keyword"!==n)return t;let i=t.toLowerCase(),l=o("regularTypeTitleQuantities.".concat(r,"_one"));return a?"".concat(l," ").concat(i):"".concat(o("seoRuleAlt",{type:l})," ").concat(i)},eu=(0,N.j)("block rounded object-cover object-center",{variants:{resizeIn:{width:"h-auto w-full",height:"h-full w-auto"}}}),ec=(0,i.forwardRef)((e,r)=>{let{item:t,position:n,fromView:o,children:l,uuid:s,isModal:u=!1,dataCy:c,priority:d,resizeParameter:h="width",blockViewSimilar:m=!1}=e,{preview:p,name:w,premium:g,isAIGenerated:b,topSearchExpressions:v,type:_,author:{id:j,name:y},url:k,id:$,isEditableInMockup:T,isEditableInWepik:D}=t,[O,W]=(0,i.useState)(!1),G=(0,E.f)(),{url:L,width:M,height:U}=p,q=j===R.c,J=X({item:t,isModal:u,position:n,fromView:o,uuid:s}),z=(0,P.o)(L,G?{w:"740",q:"80"}:{q:"80"}),H=(0,f.Zh)({itemId:t.id,isModal:u,previewUrlParams:z.includes("?")?new URLSearchParams(z.split("?")[1]).toString():""}),B=es({type:_,name:w,isPremium:g,fromView:o}),F=(0,A.z)({id:t.id,type:t.type,premium:t.premium,position:null!=n?n:0}),{height:V}=(0,x.n)(r),K="width"===h?"":"h-full";return(0,a.jsx)(S.l,{thumbnailHeight:null!=V?V:0,children:(0,a.jsxs)("figure",{className:(0,N.cx)("relative",K),ref:r,"data-cy":c,onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:[(0,a.jsxs)(C(),{...J,className:(0,N.cx)("block rounded-xl overflow-hidden",K),prefetch:!1,onClick:H,children:[(0,a.jsx)(I(),{src:z,alt:B,width:M,height:U,className:eu({resizeIn:h}),priority:d,onLoad:F,suppressHydrationWarning:!0}),(0,a.jsx)("div",{className:"absolute inset-0","aria-hidden":"true"})]}),(0,a.jsx)(Z,{resource:{...t,authorName:t.author.name},isDisneyResource:q}),O&&(0,a.jsx)(el,{authorId:j,authorName:y,thumbnailRef:r,fromView:o,url:k,id:$,name:w,preview:p,type:_,topSearchExpressions:v,premium:g,isAIGenerated:b,isEditableInMockup:T,isEditableInWepik:D,blockViewSimilar:m,children:l})]})})});var ed=t(33523),eh=t(72570),em=t(14639),ef=t(93682);let ep=e=>{var r;let{item:t}=e,{id:n,name:o,author:i,type:l,premium:s,isAIGenerated:u,url:c,preview:d,isEditableInMockup:h,isEditableInWepik:m}=t,{isDownloading:f,handleDownloadFromThumbnail:p}=w({id:n,name:o,author:i,type:null!=l?l:"photo",premium:s,isAIGenerated:u,url:c,preview:{url:null!==(r=null==d?void 0:d.url)&&void 0!==r?r:"",height:null==d?void 0:d.height,width:null==d?void 0:d.width},isEditableInMockup:h,isEditableInWepik:m});return(0,a.jsx)("aside",{className:"$absolute $right-10 $top-10 $flex $flex-col $gap-10 $opacity-0 $transition-all [figure:hover_&]:$opacity-100",children:(0,a.jsx)(em.W,{onDownload:p,isDownloading:f})})},ew=e=>{var r;let{item:t,categoryGAEvent:n,fromElement:o}=e,{premium:l,id:s,type:u,isEditableInMockup:c,isEditableInWepik:d,preview:m,url:f,author:p,isAIGenerated:w,name:g,topSearchExpressions:b}=t,v="".concat(f).concat(o?"#from_element=".concat(o):""),_=null!==(r=null==m?void 0:m.url)&&void 0!==r?r:"",j=p.id===R.c,{width:y,height:k}=null!=m?m:{width:ef.U,height:ef.w,url:""},N=ef.w*(y/k),[$,T]=(0,i.useState)(!1),P=(0,i.useRef)(null),{isLoading:E,loaded:A}=(0,eh._)(_),D=(0,h.O5)(),W=(0,B.useRouter)(),G=(0,O.Zh)({itemId:s,isModal:!0}),{height:L}=(0,x.n)(P);return(0,a.jsx)(S.l,{thumbnailHeight:null!=L?L:0,children:(0,a.jsxs)("figure",{className:"$relative",ref:P,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:[(0,a.jsxs)(C(),{href:{pathname:W.pathname,query:W.query},as:v,shallow:!0,scroll:!1,className:eg,prefetch:!1,onClick:e=>{n&&D(s,n,u),G(e)},children:[(0,a.jsx)(Z,{resource:{...t,authorName:t.author.name},isDisneyResource:j}),E&&m&&(0,a.jsx)(ed.O.Rect,{style:{width:N,height:ef.w}}),(0,a.jsx)(I(),{className:eb({show:!E}),src:_,alt:g,onLoad:A,width:N,height:ef.w,quality:90,loading:"lazy"}),(0,a.jsx)("div",{className:"absolute inset-0","aria-hidden":"true"})]}),$&&(0,a.jsx)(el,{authorId:p.id,authorName:p.name,thumbnailRef:P,fromView:"resource_detail",url:f,id:s,name:g,preview:m,type:u,topSearchExpressions:b,premium:l,isAIGenerated:w,isEditableInMockup:c,isEditableInWepik:d,blockViewSimilar:!1,children:(0,a.jsx)(ep,{item:t})})]})})},eg=(0,N.cx)('overflow-hidden block relative rounded-xl h-[200px] before:content-[""] before:absolute before:top-0 before:left-0 before:right-0 before:bottom-0 before:bg-darkBlueBlackale before:opacity-0 hover:before:opacity-20'),eb=(0,N.j)("h-full object-cover",{variants:{show:{false:"absolute opacity-0"}}})},48976:function(e,r,t){t.d(r,{t:function(){return d}});var a=t(97458),n=t(770),o=t(55570),i=t(57291),l=t(58058),s=t.n(l);let u=(0,i.j)(void 0,{variants:{theme:{dark:"pointer-events-auto block overflow-hidden text-ellipsis rounded-xl bg-overlay-dialog px-3 py-1 text-sm text-white hover:bg-neutral-900",default:"",new_up:"$inline-flex $h-[32px] $items-center $whitespace-nowrap $rounded-full $border-xs $bg-surface-0 $px-15 $text-xs $text-surface-foreground-0 $transition-colors focus:$bg-surface-3 border-surface-border-1 hover:border-surface-border-2 focus:border-surface-border-2",new:"$inline-flex $h-[32px] $items-center $whitespace-nowrap $rounded-full $border-xs $bg-surface-0 $px-15 $text-xs $text-surface-foreground-0 $transition-colors focus:$bg-surface-3 border-surface-border-1 hover:border-surface-border-2 focus:border-surface-border-2"}}}),c=e=>{let{name:r,icon:t}=e;return(0,a.jsxs)(a.Fragment,{children:[t&&(0,a.jsx)(n.J,{as:t,size:"sm",className:"$mr-10"}),r]})},d=e=>{let{onClick:r,name:t,href:n,as:i,icon:l,theme:d="default",id:h,...m}=e;return(0,a.jsx)("li",{...m,className:o.Mx,id:h,children:(0,a.jsx)(s(),{href:n,as:i,prefetch:!1,legacyBehavior:!0,passHref:!0,children:(0,a.jsx)("a",{onClick:r,href:n,className:u({theme:d}),children:(0,a.jsx)(c,{name:t,icon:l})})})})}},69727:function(e,r,t){t.d(r,{j:function(){return h}});var a=t(97458),n=t(48976),o=t(94406),i=t(68147),l=t(83380),s=t(5704),u=t(35576),c=t(7009);let d=e=>{let r=(0,l.Z)(),t=(0,s.Jn)("term"),a=(0,i.I)()||0,n=(0,c.J)();return(o,i)=>{let l="term-related&language=".concat(r,"&ref=").concat(t,"&rel=").concat(i,"&ori=").concat(e,"&pos=").concat(o+1,"&uid=").concat(a).concat(n);(0,u.OA)(encodeURI(l.toLowerCase()))}},h=e=>{let{basePath:r,source:t,items:i=[],icon:l,theme:s}=e,u=(0,o.S)({basePath:r,items:i}),c=d(t);return(0,a.jsx)(a.Fragment,{children:u.map((e,r)=>(0,a.jsx)(n.t,{href:e.href,as:e.as,name:e.name,onClick:()=>c(r,e.name),icon:l,theme:s,id:"related-tag-item-".concat(e.name)},"".concat(e.name,"-").concat(e.href,"-").concat(r)))})}},94406:function(e,r,t){t.d(r,{S:function(){return o}});var a=t(87420),n=t(52983);let o=e=>{let{basePath:r,items:t}=e,o=(0,a.L3)()(r);return(0,n.useMemo)(()=>t.map(e=>{let{name:t,slug:a,url:n,as:i}=e,l="".concat(o,"/").concat(a),s="".concat(r,"/").concat(a);return{name:t,href:null!=n?n:s,as:null!=i?i:l}}),[t,o,r])}},31760:function(e,r,t){t.d(r,{k:function(){return l}});var a=t(97458),n=t(69727),o=t(5704);let i={psd:"/psd",vector:"/vectors",photo:"/photos",font:"/fonts"},l=e=>{var r;let{items:t,maxTags:l=3}=e,s=i[null!==(r=(0,o.Jn)("type"))&&void 0!==r?r:""]||"/free-photos-vectors";if(!t||0===t.length||l<=0)return null;let u=t.slice(0,l);return(0,a.jsx)("ul",{className:"relative mt-4 flex size-full flex-wrap gap-3",children:(0,a.jsx)(n.j,{basePath:s,items:u,source:"tag",theme:"dark"})})}},18313:function(e,r,t){t.d(r,{X:function(){return N}});var a=t(52983),n=t(33247),o=t(94608),i=t(33843),l=t(43186),s=t(75045),u=t(64979),c=t(52753);let d={retouch:{resource_detail:u.EQ,download_popover:u.Kq,attribution:u.wy},expand:{resource_detail:u.S3,attribution:u.YT,carousel:u.OI,removebg:u.Iu,download_popover:u.e5},reimagine:{resource_detail:u.Vj,download_popover:u.wK,attribution:u.f3,resource_detail_hover:u.Vj},adjust:{resource_detail:u.Nc,resource_detail_hover:u.Nc},replacebg:{resource_detail:u.Zv},video:{resource_detail:u.W$,resource_detail_hover:u.W$},assistant:{resource_detail:u.$m},generatePrompt:{resource_detail:u.F4},styleReference:{resource_detail:u.IS},workflow:{resource_detail:u.$m}},h={createSocialPost:"workflow_create_post",createPoster:"workflow_create_poster",createFlyer:"workflow_create_flyer",mixImages:"workflow_mix_images",applyPromo:"workflow_apply_promo"},m=(e,r)=>{var t;return e?"workflow"===e&&(0,i.BP)(r)?h[r]:null===(t=d[e])||void 0===t?void 0:t.modifier:void 0},f=e=>{var r,t;let{tool:i,subOption:u,resourceData:h,location:f="resource_detail"}=e,{id:p,name:w,author:g,type:b,isAIGenerated:v,premium:x,url:_,preview:j}=h,y=(0,n.R)(),k="resource_detail"===f?(0,c.d)(x,i,u):f,N=y({...(0,o.W)(i,u),type:b,authorName:g.name,isPremium:x,isAIGenerated:v,eventName:"thumbnail_ai_tools"===f?"ai_gen__thumbnail":"ai_gen"}),{handleDownload:$}=(0,s.i)({resource:{id:p,name:w,author:g,premium:x,regularType:b,isAIGenerated:v,url:_,preview:j},action:null!==(t=null===(r=d[null!=i?i:"all"])||void 0===r?void 0:r[f])&&void 0!==t?t:"download",modifier:m(i,u),showAttributionModal:!1,location:k,checkoutQueryParams:N}),I=(0,l.J)();return(0,a.useCallback)(async(e,r)=>{let t=await $(e,r);if(!(null==t?void 0:t.signedUrl))throw Error("Failed to download image");return I(),t.signedUrl},[$,I])},p={styleReference:"ai-image-generator",generatePrompt:"ai-image-generator",video:"ai-video-generator",assistant:"assistant",adjust:"image-editor",reimagine:"reimagine",expand:"image-editor",retouch:"image-editor",replacebg:"image-editor"},w={video:"startFrame",generatePrompt:"image_prompt",styleReference:"image_style_ref"},g=["createPoster","createFlyer","mixImages","applyPromo"],b=(e,r)=>{var t;return"workflow"===e&&(0,i.BP)(r)&&g.includes(r)?null:null!==(t=w[e])&&void 0!==t?t:"image"},v={replacebg:"background"},x=e=>{let{resourceData:r,imageUrl:t,tool:n,location:o,subOption:i}=e,{preview:{url:l},name:s,type:u,author:{name:c},premium:d,isAIGenerated:h}=r,m="/pikaso",p=y(n,i),w=f({tool:n,subOption:i,location:o,resourceData:r});return(0,a.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=null!=t?t:l,a=await w(r);t||(r="".concat(a).concat(a.includes("?")?"&":"?","w=2000"));let f=new URLSearchParams;if(e&&Object.entries(e).forEach(e=>{let[r,t]=e;t&&f.set(r,t)}),n){var g;f.set("tool",null!==(g=j(n,i))&&void 0!==g?g:n)}let v=b(n,i);v&&f.set(v,r),f.set("title",s),f.set("location",null!=o?o:"resource_detail"),f.set("item_type",u),f.set("item_author",c),f.set("is_premium_item",d?"true":"false"),f.set("is_ai_generated",h?"true":"false");let x=window.open("about:blank");x?x.location.href="".concat(m,"/").concat(p,"?").concat(f):document.location.href="".concat(m,"/").concat(p,"?").concat(f)},[c,w,l,t,h,o,s,d,i,n,p,u])},_={createSocialPost:{url:"assistant"},createPoster:{url:"assistant"},createFlyer:{url:"assistant"},mixImages:{url:"assistant"},applyPromo:{url:"assistant"}},j=(e,r)=>{var t;return"workflow"===e&&(0,i.BP)(r)?_[r].tool:null!==(t=v[e])&&void 0!==t?t:e},y=(e,r)=>"workflow"===e&&(0,i.BP)(r)?_[r].url:p[e];var k=t(42997);let N=e=>{let r=x(e),{tool:t,subOption:i,resourceData:{type:l,author:{name:s},premium:u,isAIGenerated:c},queryParams:d}=e,h=(0,n.R)()({...(0,o.W)(t,i),type:l,authorName:s,isPremium:u,isAIGenerated:c,eventName:"ai_gen__thumbnail"}),m=(0,k.i)({...e,checkoutQueryParams:h});return(0,a.useCallback)(()=>{m()||r(d)},[r,m,d])}},83910:function(e,r,t){var a=t(97458);r.Z=e=>(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 24 24","aria-hidden":!0,...e,children:(0,a.jsx)("path",{d:"M23.531 7.266v11.812a3.05 3.05 0 0 1-3.047 3.047H3.516a3.05 3.05 0 0 1-3.047-3.047V4.922a3.05 3.05 0 0 1 3.047-3.047h3.28a3.05 3.05 0 0 1 2.966 2.344h10.722a3.05 3.05 0 0 1 3.047 3.047"})})}}]);